

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>存储池归置和存储类 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="多站同步策略" href="../multisite-sync-policy/" />
    <link rel="prev" title="Zone Features" href="../zone-features/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../">Ceph 对象网关</a></li>
      <li class="breadcrumb-item active">存储池归置和存储类</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../_sources/radosgw/placement.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Ceph 对象网关</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../frontends/">HTTP 前端</a></li>
<li class="toctree-l2"><a class="reference internal" href="../multisite/">多站配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../zone-features/">域的功能</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">存储池归置与存储类</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id2">归置目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="#storage-classes">存储类</a></li>
<li class="toctree-l3"><a class="reference internal" href="#zonegroup-zone">Zonegroup/Zone 配置</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id4">新增一个归置目标</a></li>
<li class="toctree-l4"><a class="reference internal" href="#adding-a-storage-class">新增一个存储类</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#customizing-placement">Customizing Placement</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#default-placement">Default Placement</a></li>
<li class="toctree-l4"><a class="reference internal" href="#user-placement">User Placement</a></li>
<li class="toctree-l4"><a class="reference internal" href="#s3-bucket-placement">S3 Bucket Placement</a></li>
<li class="toctree-l4"><a class="reference internal" href="#swift-bucket-placement">Swift Bucket Placement</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#using-storage-classes">Using Storage Classes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../multisite-sync-policy/">多站同步策略配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../pools/">存储池的配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../config-ref/">配置参考</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/">管理指南</a></li>
<li class="toctree-l2"><a class="reference internal" href="../account/">用户账户</a></li>
<li class="toctree-l2"><a class="reference internal" href="../s3/">S3 API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../iam/">IAM API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rgw-cache/">数据缓存和 CDN</a></li>
<li class="toctree-l2"><a class="reference internal" href="../swift/">Swift API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../adminops/">管理操作 API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api/">Python 接口</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nfs/">通过 NFS 导出</a></li>
<li class="toctree-l2"><a class="reference internal" href="../keystone/">与 OpenStack Keystone 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../barbican/">与 OpenStack Barbican 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../vault/">与 HashiCorp Vault 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../kmip/">与 KMIP 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../opa/">与 Open Policy Agent 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../multitenancy/">多租户</a></li>
<li class="toctree-l2"><a class="reference internal" href="../compression/">压缩</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ldap-auth/">LDAP 认证</a></li>
<li class="toctree-l2"><a class="reference internal" href="../encryption/">服务器端加密</a></li>
<li class="toctree-l2"><a class="reference internal" href="../bucketpolicy/">桶策略</a></li>
<li class="toctree-l2"><a class="reference internal" href="../dynamicresharding/">动态的桶索引重分片</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mfa/">多因子认证</a></li>
<li class="toctree-l2"><a class="reference internal" href="../sync-modules/">同步模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../notifications/">Bucket Notifications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../layout/">RADOS 中的数据布局</a></li>
<li class="toctree-l2"><a class="reference internal" href="../STS/">STS</a></li>
<li class="toctree-l2"><a class="reference internal" href="../STSLite/">STS Lite</a></li>
<li class="toctree-l2"><a class="reference internal" href="../keycloak/">Keycloak</a></li>
<li class="toctree-l2"><a class="reference internal" href="../session-tags/">Session Tags</a></li>
<li class="toctree-l2"><a class="reference internal" href="../role/">Role</a></li>
<li class="toctree-l2"><a class="reference internal" href="../orphans/">Orphan List and Associated Tooliing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../oidc/">OpenID Connect Provider</a></li>
<li class="toctree-l2"><a class="reference internal" href="../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/8/radosgw/">radosgw 手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/8/radosgw-admin/">radosgw-admin 手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../qat-accel/">使用 QAT 为加密和压缩提速</a></li>
<li class="toctree-l2"><a class="reference internal" href="../s3select/">S3-select</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lua-scripting/">Lua Scripting</a></li>
<li class="toctree-l2"><a class="reference internal" href="../d3n_datacache/">D3N Data Cache</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cloud-transition/">Cloud Transition</a></li>
<li class="toctree-l2"><a class="reference internal" href="../metrics/">Metrics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../uadk-accel/">UADK Acceleration for Compression</a></li>
<li class="toctree-l2"><a class="reference internal" href="../bucket_logging/">桶的日志记录</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="id1">
<h1><a class="toc-backref" href="#id7" role="doc-backlink">存储池归置和存储类</a><a class="headerlink" href="#id1" title="Permalink to this heading"></a></h1>
<nav class="contents" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#id1" id="id7">存储池归置和存储类</a></p>
<ul>
<li><p><a class="reference internal" href="#id2" id="id8">归置目标</a></p></li>
<li><p><a class="reference internal" href="#storage-classes" id="id9">存储类</a></p></li>
<li><p><a class="reference internal" href="#zonegroup-zone" id="id10">Zonegroup/Zone 配置</a></p>
<ul>
<li><p><a class="reference internal" href="#id4" id="id11">新增一个归置目标</a></p></li>
<li><p><a class="reference internal" href="#adding-a-storage-class" id="id12">新增一个存储类</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#customizing-placement" id="id13">Customizing Placement</a></p>
<ul>
<li><p><a class="reference internal" href="#default-placement" id="id14">Default Placement</a></p></li>
<li><p><a class="reference internal" href="#user-placement" id="id15">User Placement</a></p></li>
<li><p><a class="reference internal" href="#s3-bucket-placement" id="id16">S3 Bucket Placement</a></p></li>
<li><p><a class="reference internal" href="#swift-bucket-placement" id="id17">Swift Bucket Placement</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#using-storage-classes" id="id18">Using Storage Classes</a></p></li>
</ul>
</li>
</ul>
</nav>
<section id="id2">
<h2><a class="toc-backref" href="#id8" role="doc-backlink">归置目标</a><a class="headerlink" href="#id2" title="Permalink to this heading"></a></h2>
<div class="versionadded">
<p><span class="versionmodified added">New in version Jewel.</span></p>
</div>
<p>Placement targets control which <a class="reference external" href="../pools">Pools</a> are associated with a particular
bucket. A bucket’s placement target is selected on creation, and cannot be
modified. The <code class="docutils literal notranslate"><span class="pre">radosgw-admin</span> <span class="pre">bucket</span> <span class="pre">stats</span></code> command will display its
<code class="docutils literal notranslate"><span class="pre">placement_rule</span></code>.</p>
<p>The zonegroup configuration contains a list of placement targets with an
initial target named <code class="docutils literal notranslate"><span class="pre">default-placement</span></code>. The zone configuration then maps
each zonegroup placement target name onto its local storage. This zone
placement information includes the <code class="docutils literal notranslate"><span class="pre">index_pool</span></code> name for the bucket index,
the <code class="docutils literal notranslate"><span class="pre">data_extra_pool</span></code> name for metadata about incomplete multipart uploads,
and a <code class="docutils literal notranslate"><span class="pre">data_pool</span></code> name for each storage class.</p>
</section>
<section id="storage-classes">
<span id="id3"></span><h2><a class="toc-backref" href="#id9" role="doc-backlink">存储类</a><a class="headerlink" href="#storage-classes" title="Permalink to this heading"></a></h2>
<div class="versionadded">
<p><span class="versionmodified added">New in version Nautilus.</span></p>
</div>
<p>Storage classes are used to customize the placement of object data. S3 Bucket
Lifecycle rules can automate the transition of objects between storage classes.</p>
<p>Storage classes are defined in terms of placement targets. Each zonegroup
placement target lists its available storage classes with an initial class
named <code class="docutils literal notranslate"><span class="pre">STANDARD</span></code>. The zone configuration is responsible for providing a
<code class="docutils literal notranslate"><span class="pre">data_pool</span></code> pool name for each of the zonegroup’s storage classes.</p>
</section>
<section id="zonegroup-zone">
<h2><a class="toc-backref" href="#id10" role="doc-backlink">Zonegroup/Zone 配置</a><a class="headerlink" href="#zonegroup-zone" title="Permalink to this heading"></a></h2>
<p>Placement configuration is performed with <code class="docutils literal notranslate"><span class="pre">radosgw-admin</span></code> commands on
the zonegroups and zones.</p>
<p>The zonegroup placement configuration can be queried with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ radosgw-admin zonegroup get
{
    &quot;id&quot;: &quot;ab01123f-e0df-4f29-9d71-b44888d67cd5&quot;,
    &quot;name&quot;: &quot;default&quot;,
    &quot;api_name&quot;: &quot;default&quot;,
    ...
    &quot;placement_targets&quot;: [
        {
            &quot;name&quot;: &quot;default-placement&quot;,
            &quot;tags&quot;: [],
            &quot;storage_classes&quot;: [
                &quot;STANDARD&quot;
            ]
        }
    ],
    &quot;default_placement&quot;: &quot;default-placement&quot;,
    ...
}
</pre></div>
</div>
<p>The zone placement configuration can be queried with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ radosgw-admin zone get
{
    &quot;id&quot;: &quot;557cdcee-3aae-4e9e-85c7-2f86f5eddb1f&quot;,
    &quot;name&quot;: &quot;default&quot;,
    &quot;domain_root&quot;: &quot;default.rgw.meta:root&quot;,
    ...
    &quot;placement_pools&quot;: [
        {
            &quot;key&quot;: &quot;default-placement&quot;,
            &quot;val&quot;: {
                &quot;index_pool&quot;: &quot;default.rgw.buckets.index&quot;,
                &quot;storage_classes&quot;: {
                    &quot;STANDARD&quot;: {
                        &quot;data_pool&quot;: &quot;default.rgw.buckets.data&quot;
                    }
                },
                &quot;data_extra_pool&quot;: &quot;default.rgw.buckets.non-ec&quot;,
                &quot;index_type&quot;: 0,
                &quot;inline_data&quot;: true
            }
        }
    ],
    ...
}
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If you have not done any previous <a class="reference external" href="../multisite">Multisite Configuration</a>,
a <code class="docutils literal notranslate"><span class="pre">default</span></code> zone and zonegroup are created for you, and changes
to the zone/zonegroup will not take effect until the Ceph Object
Gateways are restarted. If you have created a realm for multisite,
the zone/zonegroup changes will take effect once the changes are
committed with <code class="docutils literal notranslate"><span class="pre">radosgw-admin</span> <span class="pre">period</span> <span class="pre">update</span> <span class="pre">--commit</span></code>.</p>
</div>
<section id="id4">
<h3><a class="toc-backref" href="#id11" role="doc-backlink">新增一个归置目标</a><a class="headerlink" href="#id4" title="Permalink to this heading"></a></h3>
<p>To create a new placement target named <code class="docutils literal notranslate"><span class="pre">temporary</span></code>, start by adding it to
the zonegroup:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ radosgw-admin zonegroup placement add \
      --rgw-zonegroup default \
      --placement-id temporary
</pre></div>
</div>
<p>Then provide the zone placement info for that target:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ radosgw-admin zone placement add \
      --rgw-zone default \
      --placement-id temporary \
      --data-pool default.rgw.temporary.data \
      --index-pool default.rgw.temporary.index \
      --data-extra-pool default.rgw.temporary.non-ec
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>With default placement target settings, RGW stores an object’s first data chunk in the RADOS <cite>HEAD</cite> object along
with XATTR metadata. The <cite>--placement-inline-data=false</cite> flag may be passed with the <cite>zone placement add</cite> or
<cite>zone placement modify</cite> commands to change this behavior for new objects stored on the target.
When data is stored inline (default), it may provide an advantage for read/write workloads since the first chunk of
an object’s data can be retrieved/stored in a single librados call along with object metadata. On the other hand, a
target that does not store data inline can provide a performance benefit for RGW client delete requests when
the BlueStore DB is located on faster storage than bucket data since it eliminates the need to access
slower devices synchronously while processing the client request. In that case, data associated with the deleted
objects is removed asynchronously in the background by garbage collection. Note that inlining is only ever performed
when writing to the default storage class.  Inlining is <em>never</em> performed when writing to a non-default
storage class.</p>
</div>
</section>
<section id="adding-a-storage-class">
<span id="id5"></span><h3><a class="toc-backref" href="#id12" role="doc-backlink">新增一个存储类</a><a class="headerlink" href="#adding-a-storage-class" title="Permalink to this heading"></a></h3>
<p>To add a new storage class named <code class="docutils literal notranslate"><span class="pre">GLACIER</span></code> to the <code class="docutils literal notranslate"><span class="pre">default-placement</span></code> target,
start by adding it to the zonegroup:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ radosgw-admin zonegroup placement add \
      --rgw-zonegroup default \
      --placement-id default-placement \
      --storage-class GLACIER
</pre></div>
</div>
<p>Then provide the zone placement info for that storage class:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ radosgw-admin zone placement add \
      --rgw-zone default \
      --placement-id default-placement \
      --storage-class GLACIER \
      --data-pool default.rgw.glacier.data \
      --compression lz4
</pre></div>
</div>
</section>
</section>
<section id="customizing-placement">
<h2><a class="toc-backref" href="#id13" role="doc-backlink">Customizing Placement</a><a class="headerlink" href="#customizing-placement" title="Permalink to this heading"></a></h2>
<section id="default-placement">
<h3><a class="toc-backref" href="#id14" role="doc-backlink">Default Placement</a><a class="headerlink" href="#default-placement" title="Permalink to this heading"></a></h3>
<p>By default, new buckets will use the zonegroup’s <code class="docutils literal notranslate"><span class="pre">default_placement</span></code> target.
This zonegroup setting can be changed with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ radosgw-admin zonegroup placement default \
      --rgw-zonegroup default \
      --placement-id new-placement
</pre></div>
</div>
</section>
<section id="user-placement">
<h3><a class="toc-backref" href="#id15" role="doc-backlink">User Placement</a><a class="headerlink" href="#user-placement" title="Permalink to this heading"></a></h3>
<p>A Ceph Object Gateway user can override the zonegroup’s default placement
target by setting a non-empty <code class="docutils literal notranslate"><span class="pre">default_placement</span></code> field in the user info.
Similarly, the <code class="docutils literal notranslate"><span class="pre">default_storage_class</span></code> can override the <code class="docutils literal notranslate"><span class="pre">STANDARD</span></code>
storage class applied to objects by default.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ radosgw-admin user info --uid testid
{
    ...
    &quot;default_placement&quot;: &quot;&quot;,
    &quot;default_storage_class&quot;: &quot;&quot;,
    &quot;placement_tags&quot;: [],
    ...
}
</pre></div>
</div>
<p>If a zonegroup’s placement target contains any <code class="docutils literal notranslate"><span class="pre">tags</span></code>, users will be unable
to create buckets with that placement target unless their user info contains
at least one matching tag in its <code class="docutils literal notranslate"><span class="pre">placement_tags</span></code> field. This can be useful
to restrict access to certain types of storage.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">radosgw-admin</span></code> command can modify these fields directly with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ radosgw-admin user modify \
      --uid &lt;user-id&gt; \
      --placement-id &lt;default-placement-id&gt; \
      --storage-class &lt;default-storage-class&gt; \
      --tags &lt;tag1,tag2&gt;
</pre></div>
</div>
</section>
<section id="s3-bucket-placement">
<span id="id6"></span><h3><a class="toc-backref" href="#id16" role="doc-backlink">S3 Bucket Placement</a><a class="headerlink" href="#s3-bucket-placement" title="Permalink to this heading"></a></h3>
<p>When creating a bucket with the S3 protocol, a placement target can be
provided as part of the LocationConstraint to override the default placement
targets from the user and zonegroup.</p>
<p>Normally, the LocationConstraint must match the zonegroup’s <code class="docutils literal notranslate"><span class="pre">api_name</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">LocationConstraint</span><span class="o">&gt;</span><span class="n">default</span><span class="o">&lt;/</span><span class="n">LocationConstraint</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>A custom placement target can be added to the <code class="docutils literal notranslate"><span class="pre">api_name</span></code> following a colon:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">LocationConstraint</span><span class="o">&gt;</span><span class="n">default</span><span class="p">:</span><span class="n">new</span><span class="o">-</span><span class="n">placement</span><span class="o">&lt;/</span><span class="n">LocationConstraint</span><span class="o">&gt;</span>
</pre></div>
</div>
</section>
<section id="swift-bucket-placement">
<h3><a class="toc-backref" href="#id17" role="doc-backlink">Swift Bucket Placement</a><a class="headerlink" href="#swift-bucket-placement" title="Permalink to this heading"></a></h3>
<p>用 Swift 协议创建桶时，可以用 HTTP 头的 <code class="docutils literal notranslate"><span class="pre">X-Storage-Policy</span></code> 设置归置靶。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">X</span><span class="o">-</span><span class="n">Storage</span><span class="o">-</span><span class="n">Policy</span><span class="p">:</span> <span class="n">new</span><span class="o">-</span><span class="n">placement</span>
</pre></div>
</div>
</section>
</section>
<section id="using-storage-classes">
<h2><a class="toc-backref" href="#id18" role="doc-backlink">Using Storage Classes</a><a class="headerlink" href="#using-storage-classes" title="Permalink to this heading"></a></h2>
<p>All placement targets have a <code class="docutils literal notranslate"><span class="pre">STANDARD</span></code> storage class which is applied to
new objects by default. The user can override this default with its
<code class="docutils literal notranslate"><span class="pre">default_storage_class</span></code>.</p>
<p>To create an object in a non-default storage class, provide that storage class
name in an HTTP header with the request. The S3 protocol uses the
<code class="docutils literal notranslate"><span class="pre">X-Amz-Storage-Class</span></code> header, while the Swift protocol uses the
<code class="docutils literal notranslate"><span class="pre">X-Object-Storage-Class</span></code> header.</p>
<p>S3 Object Lifecycle Management can then be used to move object data between
storage classes using <code class="docutils literal notranslate"><span class="pre">Transition</span></code> actions.</p>
<p>When using AWS S3 SDKs such as <code class="docutils literal notranslate"><span class="pre">boto3</span></code>, it is important that
storage class names match those provided by AWS S3, or else the SDK
will drop the request and raise an exception.  Moreover, some S3 clients
and libraries expect AWS-specific behavior when a storage class named
or prefixed with <code class="docutils literal notranslate"><span class="pre">GLACIER</span></code> is used and thus will fail when accessing
Ceph RGW services.  For this reason we advise that other storage class
names be used with Ceph, including <code class="docutils literal notranslate"><span class="pre">INTELLIGENT-TIERING</span></code>, <code class="docutils literal notranslate"><span class="pre">STANDARD_IA</span></code>,
<code class="docutils literal notranslate"><span class="pre">REDUCED_REDUNDANCY</span></code>, and <code class="docutils literal notranslate"><span class="pre">ONEZONE_IA</span></code>. Custom storage class names like
<code class="docutils literal notranslate"><span class="pre">CHEAPNDEEP</span></code> are accepted by Ceph but might not be by some clients and
libraries.</p>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../zone-features/" class="btn btn-neutral float-left" title="Zone Features" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../multisite-sync-policy/" class="btn btn-neutral float-right" title="多站同步策略" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>